home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Netherlands - A Compact World
/
The Netherlands.iso
/
chapters
/
2.5.dxr
/
Internal_31_V2 tekstimport2 met MAC, MacChars, Edit, Tekstkleur EN LINKS!! (dubbel).ls
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
2004-06-10
|
4.2 KB
|
126 lines
property spriteNum, pWoordenlijst
global taalkeuze, maclist, tekstkleur, woordenteller
on vertalen me
sprite(spriteNum).visibility = 0
if tekstkleur = VOID then
sprite(spriteNum).member.foreColor = 235
else
sprite(spriteNum).member.foreColor = tekstkleur
end if
if taalkeuze = VOID then
taalkeuze = "nl"
end if
tekstpad = "@txt:" & taalkeuze & ":"
fieldnaam = sprite(spriteNum).member.name
bestandnaam = fieldnaam & ".txt"
pWoordenlijst = []
woordenteller = 1
buffer = new(xtra("fileio"))
openFile(buffer, tekstpad & bestandnaam, 1)
setPosition(buffer, 0)
bufferinhoud = readFile(buffer)
closeFile(buffer)
put bufferinhoud into member fieldnaam
repeat with Tellertje8 = 1 to member(fieldnaam).text.length
if member(fieldnaam).char[Tellertje8] = numToChar(10) then
put EMPTY into (member fieldnaam).char[Tellertje8]
end if
if member(fieldnaam).char[Tellertje8].charToNum > 127 then
if the platform contains "Mac" then
put numToChar(maclist[member(fieldnaam).char[Tellertje8].charToNum - 127]) into (member fieldnaam).char[Tellertje8]
end if
end if
if member(fieldnaam).char[Tellertje8] = "#" then
put EMPTY into (member fieldnaam).char[Tellertje8]
invoercharacter = EMPTY
linkbeschrijving = EMPTY
repeat while invoercharacter <> "|"
invoercharacter = member(fieldnaam).char[Tellertje8]
linkbeschrijving = linkbeschrijving & invoercharacter
put EMPTY into (member fieldnaam).char[Tellertje8]
end repeat
put EMPTY into linkbeschrijving.char[the length of linkbeschrijving]
startselectie = Tellertje8 + 2
repeat while invoercharacter <> "#"
Tellertje8 = Tellertje8 + 1
invoercharacter = member(fieldnaam).char[Tellertje8]
if member(fieldnaam).char[Tellertje8] = numToChar(10) then
put EMPTY into (member fieldnaam).char[Tellertje8]
end if
if member(fieldnaam).char[Tellertje8] = numToChar(32) then
woordenteller = woordenteller + 1
end if
if member(fieldnaam).char[Tellertje8].charToNum > 127 then
if the platform contains "Mac" then
put numToChar(maclist[member(fieldnaam).char[Tellertje8].charToNum - 127]) into (member fieldnaam).char[Tellertje8]
end if
end if
end repeat
eindeselectie = Tellertje8 - 1
put EMPTY into (member fieldnaam).char[Tellertje8]
link(me, startselectie, eindeselectie, linkbeschrijving, fieldnaam)
end if
end repeat
repeat with i = 1 to pWoordenlijst.count
if pWoordenlijst[i] <> 0 then
set the foreColor of word i of member fieldnaam to 214
end if
end repeat
sprite(spriteNum).visibility = 1
end
on beginSprite me
sendSprite(spriteNum, #vertalen)
pass()
end
on link me, start, eind, linkbeschrijving, fieldnaam
tijdelijkpunt = member(fieldnaam).charPosToLoc(start)
tijdelijkpunt.locH = tijdelijkpunt.locH + sprite(spriteNum).left
tijdelijkpunt.locV = tijdelijkpunt.locV + sprite(spriteNum).top
startwoord = sprite(spriteNum).pointToWord(tijdelijkpunt)
tijdelijkpunt = member(fieldnaam).charPosToLoc(eind)
tijdelijkpunt.locH = tijdelijkpunt.locH + sprite(spriteNum).left
tijdelijkpunt.locV = tijdelijkpunt.locV + sprite(spriteNum).top
eindwoord = sprite(spriteNum).pointToWord(tijdelijkpunt)
repeat with woord = startwoord to eindwoord
pWoordenlijst.addAt(woord, linkbeschrijving)
end repeat
end
on mouseWithin me
staticmouseword = the mouseWord
if (staticmouseword <= pWoordenlijst.count) and (staticmouseword > 0) then
if pWoordenlijst[staticmouseword] <> 0 then
cursor(280)
else
cursor(-1)
end if
end if
end
on mouseLeave me
cursor(-1)
end
on mouseUp me
global naam
staticmouseword = the mouseWord
put the mouseWord
if (staticmouseword <= pWoordenlijst.count) and (staticmouseword > 0) then
if pWoordenlijst[staticmouseword] <> 0 then
if pWoordenlijst[staticmouseword].char[1] = "@" then
naam = pWoordenlijst[staticmouseword]
put EMPTY into naam.char[1]
tell the stage
wisseltje()
end tell
else
put pWoordenlijst[staticmouseword]
do(pWoordenlijst[staticmouseword])
end if
end if
end if
end